<template>
  <nav class="bg-white border-b px-4 py-3 flex items-center justify-between">
    <div class="flex items-center gap-4">
      <router-link to="/" class="font-bold text-gray-800">问题管理</router-link>
      <router-link to="/issues" class="text-gray-600 hover:text-gray-900">问题</router-link>
      <router-link to="/knowledge" class="text-gray-600 hover:text-gray-900">知识库</router-link>
      <router-link to="/reviews" class="text-gray-600 hover:text-gray-900">复盘</router-link>
    </div>
    <div class="flex items-center gap-3" v-if="auth.user">
      <span class="text-sm text-gray-600">{{ auth.user.name }}</span>
      <button class="text-sm text-red-600" @click="logout">退出</button>
    </div>
  </nav>
</template>
<script setup>
import { useAuthStore } from '../stores/auth'
import { useRouter } from 'vue-router'
const auth = useAuthStore()
const router = useRouter()
const logout = () => { auth.clear(); router.replace('/login') }
</script>
<style>
@import "https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css";
</style>
